#include <iostream>
using namespace std;

int main()
{
    string s1;
    string s2;
    string s3;
    string s4;
    string s;
    cin>>s;
    for(char c : s) {
        if (c == '(' ){
            s1 += c;
        }
        
        if (c == ')' ) {
            if (s1.length()>0) {
                if (s1[ s1.length() - 1] == '(') {
                    s1.pop_back();
                }
            }
        }
    }
    for(char q : s) {
        if (q == '[' ){
            s1 += q;
        }
        
        if (q == ']' ) {
            if (s1.length()>0) {
                if (s1[ s1.length() - 1] == '[') {
                    s1.pop_back();
                }
            }
        }
    }
    for(char a : s) {
        if (a == '{' ){
            s1 += a;
        }
        
        if (a == '}' ) {
            if (s1.length()>0) {
                if (s1[ s1.length() - 1] == '{') {
                    s1.pop_back();
                }
            }
        }
    }
    for(char l : s) {
        if (l == '<' ){
            s1 += l;
        }
        
        if (l == '>' ) {
            if (s1.length()>0) {
                if (s1[ s1.length() - 1] == '<') {
                    s1.pop_back();
                }
            }
        }
    }
    if (s[0] != ')' and s1.length() == 0){
        cout<<"Верная"<<endl;
    }
    else{
        cout<<"Неверная"<<endl;
    }
}
